import type { BasicColumn, FormSchema ,DescItem} from '@/components/Table'
import { useRender } from '@/components/Table'

export const columns: BasicColumn[] = [
 
  {
    title: '订单编码',
    dataIndex: 'orderCode',
    width: 160,
  },
  {
    title: '游戏名称',
    dataIndex: 'gameName',
    width: 160,
  },
  {
    title: '设备名称',
    dataIndex: 'deviceName',
    width: 160,
  },
  {
    title: '游戏时长（分钟）',
    dataIndex: 'playTime',
    width: 160,
  },
  {
    title: '订单金额',
    dataIndex: 'amount',
    width: 160,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
    customRender: ({ text }) => {
      return useRender.renderDate(text)
    },
  },
]

export const detailColumns: BasicColumn[] = [
 
  {
    title: '订单编码',
    dataIndex: 'orderCode',
    width: 160,
  },
  {
    title: '游戏名称',
    dataIndex: 'gameName',
    width: 160,
  },
  {
    title: '设备名称',
    dataIndex: 'deviceName',
    width: 160,
  },
  {
    title: '游戏时长（分钟）',
    dataIndex: 'playTime',
    width: 160,
  },
  {
    title: '订单金额',
    dataIndex: 'amount',
    width: 160,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
    customRender: ({ text }) => {
      return useRender.renderDate(text)
    },
  },
]

export const searchFormSchema: FormSchema[] = [
  {
    label: '订单编码',
    field: 'orderCode',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    label: '游戏id',
    field: 'gameId',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    label: '设备id',
    field: 'deviceId',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    label: '游戏时长（分钟）',
    field: 'playTime',
    component: 'RangePicker',
    colProps: { span: 8 },
  },
  {
    label: '订单金额',
    field: 'amount',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    label: '创建时间',
    field: 'createTime',
    component: 'RangePicker',
    colProps: { span: 8 },
  },
]

export const createFormSchema: FormSchema[] = [
  {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input',
  },
  {
    label: '订单编码',
    field: 'orderCode',
    required: true,
    component: 'Input',
  },
  {
    label: '游戏id',
    field: 'gameId',
    required: true,
    component: 'Input',
  },
  {
    label: '设备id',
    field: 'deviceId',
    required: true,
    component: 'Input',
  },
  {
    label: '游戏时长（分钟）',
    field: 'playTime',
    required: true,
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'x',
    },
  },
  {
    label: '订单金额',
    field: 'amount',
    required: true,
    component: 'Input',
  },
]

export const updateFormSchema: FormSchema[] = [
  {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input',
  },
  {
    label: '订单编码',
    field: 'orderCode',
    required: true,
    component: 'Input',
  },
  {
    label: '游戏id',
    field: 'gameId',
    required: true,
    component: 'Input',
  },
  {
    label: '设备id',
    field: 'deviceId',
    required: true,
    component: 'Input',
  },
  {
    label: '游戏时长（分钟）',
    field: 'playTime',
    required: true,
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'x',
    },
  },
  {
    label: '订单金额',
    field: 'amount',
    required: true,
    component: 'Input',
  },
]
export const detailSchema: DescItem[] = [
 
  {
    label: '订单编码',
    field: 'orderCode',
  },
  {
    label: '游戏名',
    field: 'gameName',
  },
  {
    label: '设备名',
    field: 'deviceName',
  },
  {
    label: '游戏时长（分钟）',
    field: 'playTime',
  },
  {
    label: '订单金额',
    field: 'amount',
  },
]
